// OS.hpp
// Contains code to detect OS and system
#ifndef OS_HPP
#define OS_HPP

typedef enum OS_TYPE {
	OS_err = 0,
	OS_windows = 1,
	OS_apple = 2,
	OS_linux = 3,
	OS_nds = 4
} OS_TYPE;



#include <string>
#include <vector>
using std::string;
#if defined(WINDOWS) || defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64) || defined(__WIN32__)
	#define CURRENT_OS OS_windows
	#define USING_WINDOWS
	#define PATHSEPARATOR '\\'
	// Networking stuffs
	#define WIN32_LEAN_AND_MEAN
	#include <Windows.h>
	// File stuffs
	#include <direct.h>
	int MakeDir(const char*);
	int CurrentWorkingDir(char*&);
	int isDir(const char*);
	int ChangeDir(const char*);
	int Remove(const char*);
#elif defined(__APPLE__)
	#define CURRENT_OS OS_apple
	#define USING_MAC
	#define PATHSEPARATOR '/'
	#include <unistd.h>
#elif defined(__NDS__)
	#define CURRENT_OS OS_nds
	#define USING_NDS
	#define PATHSEPARATOR '\\'
	#include <nds.h>
	#if USE_FAT
	#include <fat.h>
	#endif
	void OnKeyPressed(int);
	void initDS(void);
#else
	#define CURRENT_OS OS_linux
	#define USING_LINUX
	#define PATHSEPARATOR '/'
	// File stuffs
	#include <unistd.h>
	#include <sys/stat.h>
	#include <stdlib.h>
	int MakeDir(const char*);
	int CurrentWorkingDir(char*&);
	int isDir(const char*);
	int ChangeDir(const char*);
	int Remove(const char*);
#endif

enum FileOp {opDelete = 0, opCopy = 1, opMove = 2};
int Copy(const char*, const char*);
int Move(const char*, const char*);
std::vector<std::pair<std::string, short> >* DirectoryListing(const char*, string="");
int RecursiveFileIO(string, FileOp, string);

#endif
